package com.oa.action;

import javax.annotation.Resource;

import net.sf.json.JSONObject;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.jbpm.action.BaseAction;
import com.jbpm.util.JsonBuilder;
import com.oa.model.BorrowMoney;
import com.oa.service.BorrowManager;
/**
 * 
 * @author luomj
 *
 */
@Component("borrowMoneyAction")
@Scope("prototype")
public class BorrowMoneyAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2444158984508668011L;
	private BorrowManager borrowManager;
	private BorrowMoney borrowMoney=new BorrowMoney();
	@Override
	public Object getModel() {
		// TODO Auto-generated method stub
		super.orderSql=" order by createTime desc ";
		return borrowMoney;
	}
	
    //添加初始化处理
	public void addInfo(){
		JSONObject returnObj=new JSONObject();
		borrowManager.addInfo("com.oa.model.BorrowMoney","id", returnObj);
		toWrite(JsonBuilder.getInstance().returnSuccessJson(JsonBuilder.getInstance().toJson(returnObj)));
	}
	
	
	@Resource(name="borrowManager")
	public void setBorrowManager(BorrowManager borrowManager) {
		this.borrowManager = borrowManager;
	}
	
}
